package com.koron.common.core.business.workflow.feign;

import com.koron.bean.base.Response;
import com.koron.bean.workflow.RedirectQuery;
import com.koron.bean.workflow.SubmitterParam;
import com.koron.bean.workflow.WorkflowUser;
import com.koron.common.core.feignConfig.FeignFallbackFactory;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.net.URI;
import java.util.List;

/**
 * @author jzp
 * @since 2022/1/17
 */
@Service
@FeignClient(name = "callerFeignService", fallbackFactory = FeignFallbackFactory.class)
public interface CallerFeignService {

    /**
     * 回调业务修改状态
     * 简单参数可以用@RequestBody
     */
    @RequestLine("POST")
    Response<Object> updateStatus(URI uri, @RequestBody RedirectQuery redirectQuery);

    /**
     * 获取插件过滤后的人员信息
     * 复杂参数需要用RequestBody
     * @return
     *  null  则为所有人
     *  []    则为没有人
     *  有数据 则为数据中的人
     */
    @RequestLine("POST")
    Response<List<WorkflowUser>> listWorkflowUser(URI uri, @RequestBody SubmitterParam submitterParam);

}
